package com.engineering.elink.dao;

import java.util.Date;
import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Param;

import com.engineering.elink.co.BaseCo;
import com.engineering.elink.co.FileCo;
import com.engineering.elink.domain.Course;
import com.engineering.elink.domain.File;
import com.engineering.elink.domain.Skill;
import com.engineering.elink.vo.FileVo;
import com.engineering.elink.vo.FileVo2;
import com.engineering.elink.vo.FileVo4;
import com.engineering.elink.vo.PlanVo;

public interface FileMapper {
	int deleteByPrimaryKey(String fileId);

	int insert(File record);

	int insertSelective(File record);

	File selectByPrimaryKey(String fileId);
	
	int updateByPrimaryKeySelective(File record);

	int updateByPrimaryKey(File record);
	
	FileVo2 selectInfo(@Param("fileId")String fileId,@Param("userId")String userId);
	
	List<FileVo> selectCertFileList(@Param("co")FileCo co);

	int selectCertFileCount(@Param("co")FileCo co);
	
	List<FileVo> selectBuildFileList(@Param("co")FileCo co);

	int selectBuildFileCount(@Param("co")FileCo co);
	
	List<File> getDownLoadRank(@Param("count")int count,@Param("mold")int mold);

	List<FileVo> selectRelevantList(@Param("tcId")int tcId, @Param("scId")int scId, @Param("count")int count);

	List<File> getLike(@Param("dcs")String dcs, @Param("tagIds")String tagIds, @Param("count")int count);

	File selectNext(@Param("uploadTime")Date uploadTime);
	
	File selectPre(@Param("uploadTime")Date uploadTime);

	List<FileVo> getMyCollect(@Param("co")BaseCo co,@Param("userId")String userId);
	
	int selectCountMyCollect(@Param("userId")String userId);

//	List<FileVo2> getCommentForMe(@Param("co")BaseCo co,@Param("userId")String userId);

//	List<FileVo2> getMyComment(@Param("co")BaseCo co,@Param("userId")String userId);

	List<FileVo4> getUploadFileByUserId(@Param("co")BaseCo co, @Param("userId")String userId,@Param("keyWord")String keyWord);
	
	int countUploadFileByUserId(@Param("userId")String userId,@Param("keyWord")String keyWord);
	
	List<File> getShare(@Param("userId")String userId);
	
	PlanVo getBaseInfo(@Param("hierId")int hierId, @Param("gradeId")int gradeId);
	
	List<Skill> getSkillList(@Param("hierId")int hierId, @Param("gradeId")int gradeId);
	
	List<Course> getCourseList(@Param("hierId")int hierId, @Param("gradeId")int gradeId);
	
	List<File> getFileList(@Param("hierId")int hierId, @Param("gradeId")int gradeId);

	List<Map<String, Object>> selectDatabaseListOfHome(@Param("scId") int scId);
	
	List<Map<String, Object>> selectDatabaseListOfInternational();

	List<File> selectFileBest(@Param("count")int count);
	
	List<Map<String, Object>> selectFileSystem(@Param("count")int count);
	
	List<Map<String, Object>> selectCertFile(@Param("count")int count,@Param("scId")String scId);

	List<File> selectHotFile(@Param("scId")int scId, @Param("dcId")int dcId, @Param("count")int count);
	
	Map<String, Object> selectFile (@Param("fileId")String fileId);
	
	Map<String, Object> selectThesis (@Param("fileId")String fileId);
	
	List<Map<String, Object>> selectScid(@Param("count")int count);
	
	List<File> select();

	List<Map<String, Object>> selectFileIds(@Param("co")FileCo co);
	
	List<Map<String, Object>> selectFileId(@Param("co")FileCo co);
	
	List<FileVo> selectFileVo(@Param("fileId")String fileId);

	int selectCount(@Param("co")FileCo co);
	
	List<File> selectByPath(@Param("path")String path);
	
	List<Map<String, Object>> selectByPath2(@Param("path")String path);
	
	
	List<FileVo> selectMyDownLoadFile(@Param("co")BaseCo co, @Param("userId")String userId,@Param("keyWord")String keyWord);
}